package xiegd.study;

/**
 * @Author: xieguangda
 * @Description:
 * @Date: 2023/9/1 16:32
 */

//
//class MyObject {
//    private List<String> list;
//
//    public MyObject(List<String> list) {
//        this.list = list;
//    }
//
//    public List<String> getList() {
//        return list;
//    }
//
//    @Override
//    public String toString() {
//        return "MyObject{" +
//                "list=" + list +
//                '}';
//    }
//}

public class Main3 {
    public static void main(String[] args) {
//        List<MyObject> objects = new ArrayList<>();
//        objects.add(new MyObject(Arrays.asList("a", "b", "c")));
//        objects.add(new MyObject(Arrays.asList("d")));
//        objects.add(new MyObject(Arrays.asList("e", "f", "g", "h")));

//        List<MyObject> sortedObjects = objects.stream()
//                .sorted(Comparator.comparing(MyObject::getList).reversed())
//                .collect(Collectors.toList());

//        List<MyObject> sortedObjects = objects.stream()
//                .sorted(Comparator.comparing(Function.identity(MyObject::getList)))
//                .collect(Collectors.toList());

//        System.out.println(sortedObjects);
    }
}
